package com.wql.rabbitmq.study;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

import com.rabbitmq.client.Channel;
import com.wql.rabbitmq.ChannelFactory;
import com.wql.rabbitmq.Constant;

public class DirectTestForProducter {
	public static void main(String[] args) throws IOException, TimeoutException {
		Channel channel = ChannelFactory.getChannel();
		channel.queueDeclare(Constant.QUEUE_NAME, false, false, false, null);
		String msg = "hello world";
		System.out.println("发送消息：" + msg);
		channel.basicPublish("", Constant.QUEUE_NAME, null, msg.getBytes());
		channel.basicPublish("", Constant.QUEUE_NAME, null, msg.getBytes());
		channel.basicPublish("", Constant.QUEUE_NAME, null, msg.getBytes());
		channel.basicPublish("", Constant.QUEUE_NAME, null, msg.getBytes());
	}

}
